<?php




$node = "[php_property:node]";
  $nodeUrl = "[php_property:node_url]";
  
  if ($node == "")
    $node = "web";

  if ($nodeUrl == "")
    $nodeUrl = "/web";
    
  $nodeId = db::getValue("SELECT id FROM page WHERE _url='$nodeUrl'");
    
   
   
  /*if ($domainModus) {
      $sql       ="SELECT * FROM page WHERE menu_aktiv = 1 AND _usergroup<=$userGrp
            AND item_parent_id = (SELECT id FROM page WHERE titel = '$node' AND domain='$domain') AND domain='$domain' ORDER BY item_order";
  } else {
  $sql       ="SELECT * FROM page WHERE menu_aktiv = 1 AND _usergroup<=$userGrp
            AND item_parent_id = (SELECT id FROM page WHERE titel = '$node') $domainSql ORDER BY item_order";
  } */
  
  $domainSql = "";
  /*if ($domainModus) 
      $domainSql = " AND domain='$domain'"; */
  
                                                        //AND _usergroup<=$userGrp 
   $sql       ="SELECT * FROM page WHERE menu_aktiv = 1 
            AND item_parent_id = $nodeId $domainSql ORDER BY item_order";
  
  
  $begin = str_ireplace("[sql]", $sql, $begin);











$domActiveMenu=str_get_html($html);

$activeMenu   ="";

foreach ($domActiveMenu->find("[com=active_menu]")as $e)
    {
    $activeMenu  = $e->outertext;
    $e->outertext="";
    }

$html=$domActiveMenu->save();
$domActiveMenu->clear();
unset ($domActiveMenu);

if ($activeMenu !== "")
    {
    /*$str ='<?php global $uri;if ($dataMenu->data["_url"] == $uri) { ?>';*/
    $str ='<?php global $uri;if ($dataMenu["_url"] == $uri) { ?>';
    $str =$str . $activeMenu;
    $str =$str . '<?php } else { ?>';
    $str =$str . $html;
    $str =$str . '<?php } ?>';

    $html=$str;
    }
?>